---说明
--源码地址 https://gitee.com/consolelog/d3-logitech
---配置项

--选项 "scrolllock", "numlock", "capslock"
LED = "capslock" --自行修改指示灯按键
--选项 "lalt", "ralt",   "lshift", "rshift",   "lctrl", "rctrl", "ctrl"
FuZhu = "lalt"  --自行修改辅助键（无需一键功能修改为"rshift"即可）
BiLi = { 16, 9 } --屏幕比例

---全局设置---
--启用鼠标按钮事件
EnablePrimaryMouseButtonEvents(true)
--一键分解
function FenJie()
    MoveMouseToVirtual(6000 * 16 * BiLi[2] / 9 / BiLi[1], 17000)
    Sleep(100)
    PressAndReleaseMouseButton(1)
    Sleep(50)
    k = 0
    while k < 60
    do
        X = k % 10-- 分解列
        Y = math.floor(k / 10)--分解行
        MoveMouseToVirtual(65535 - (65535 - 49000 - 1700 * X) * 16 * BiLi[2] / 9 / BiLi[1], 36000 + 3000 * Y)
        Sleep(1)
        PressAndReleaseMouseButton(1)
        Sleep(1)
        PressAndReleaseKey("Enter")
        Sleep(1)
        PressAndReleaseMouseButton(1)
        Sleep(1)
        PressAndReleaseKey("Enter")
        Sleep(1)
        k = k + 1
    end
end
--一键拾取
function ShiQu()
    k = 25
    while k > 0
    do
        PressAndReleaseMouseButton(1)
        Sleep(15)
        k = k - 1
    end
end
--一键赌博
function DuBo()
    k = 50
    while k > 0
    do
        PressAndReleaseMouseButton(3)
        Sleep(5)
        k = k - 1
    end
end
---主程序---

function OnEvent(event, arg)
    --一键赌博
    if (event == "MOUSE_BUTTON_PRESSED" and arg == 2 and IsModifierPressed(FuZhu)) then
        DuBo()
    end

    --一键分解
    if (event == "MOUSE_BUTTON_PRESSED" and arg == 4 and IsModifierPressed(FuZhu)) then
        FenJie()
    end

    --一键拾取
    if (event == "MOUSE_BUTTON_PRESSED" and arg == 1 and IsModifierPressed(FuZhu)) then
        ShiQu()
    end

end